package sharpuser;

import java.util.Scanner;

public class J03Tax {

	public static void main(String[] args) {
		// 1 변수선언
		int married;// 결혼여부,O:미혼,1:기혼
		int salary; // 연봉
		double tax = 0;
		String title1 = "결혼여부를 입력하세요(O:미혼,1:기혼)";
		String title2 = "연봉을 입력하세요";
		Scanner sc = null;

		// 2 결혼여부,연봉입력 및 세금계산
		sc = new Scanner(System.in);
		System.out.println(title1);// 결혼여부
		married = sc.nextInt();
		System.out.println(title2);// 연봉
		salary = sc.nextInt();

		if (married == 0) {
			if (salary < 3000) {
				tax = salary * 0.05;
			} else if (salary >= 3000) {
				tax = salary * 0.01;
			}

		}
		if (married == 1) {
			if (salary < 5000) {
				tax = salary * 0.15;
			} else if (salary >= 5000) {
				tax = salary * 0.3;
			}
		}

		System.out.println(married);
		System.out.println(salary);
		System.out.println(tax);

		sc.close();

	}

}
